package thread;

public class ThreadJoinTest {
	public static void main(String[] args) throws InterruptedException {
		Thread t1 = new Thread(new Runnable() {
			@Override
			public void run() {
				for(int i=0;i<10;i++){
					System.out.println(Thread.currentThread().getName()+" "+i);
				}
			}
		});
		
		Thread t2 = new Thread(new Runnable() {
			@Override
			public void run() {
				for(int i=0;i<10;i++){
					System.out.println(Thread.currentThread().getName()+" "+i);
				}
			}
		});
		
		t1.start();
		t1.join();
		t2.start();
		System.out.println("主线程。。。");
		
	}
}
